package com.anlogic.sdk.ui.tests.uc10.programfpga;

import org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot;
import org.eclipse.swtbot.eclipse.finder.waits.Conditions;
import org.eclipse.swtbot.swt.finder.utils.SWTBotPreferences;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;

import com.anlogic.sdk.ui.tests.utils.ProgramFpgaUtils;
import com.anlogic.sdk.ui.tests.utils.ProjectAttributeUtils;
import com.anlogic.sdk.ui.tests.utils.WorkspaceUtils;

public class UC10_TC001_Test {
	private static SWTWorkbenchBot bot;

	@BeforeClass
	public static void setUpBeforeClass() throws Exception {

		bot = new SWTWorkbenchBot();
		SWTBotPreferences.TIMEOUT = 10000;
		SWTBotPreferences.KEYBOARD_LAYOUT = "EN_US";
		bot.waitUntil(Conditions.shellIsActive("data - FutureDynasty"), 60 * 1000);
	}

	@Before
	public void setUp() throws Exception {
		WorkspaceUtils.resetworkbench(bot);
	}

	@After
	public void tearDown() throws Exception {
		
		bot.viewByTitle("Console (Download Tool)").show();
		bot.toolbarButtonWithTooltip("Clear Console").click();
		WorkspaceUtils.cleanWorkspace();
	}
	
	@Test 
	public void CreateFlashImageGeneral_MotorolaSrecordsymbols_Test() throws InterruptedException
	{
	    ProjectAttributeUtils.riscvTestcomboBoxWithNode(bot,"GNU RISC-V Cross Create Flash Image", "General", 1,  "Motorola S-record (symbols)", "symbolsrec");
	}
	@Test
	public void ProgramFpga_dr1m90_Local_Test() throws InterruptedException {
		ProgramFpgaUtils.programFpga(bot,"dr1m90","Local","D:\\AnlogicSDK\\resources1\\AD103_V1.0_DR1M90.bit");
	}
	@Test
	public void ProgramFpga_dr1v90_Local_Test() throws InterruptedException {
		ProgramFpgaUtils.programFpga(bot,"dr1v90","Local","D:\\AnlogicSDK\\resources1\\AD103_V1.0_DR1V90.bit");
	}
	
	@Test
	public void ProgramFpga_ph1p35_Local_Test() throws InterruptedException {
		ProgramFpgaUtils.programFpga(bot,"ph1p35","Local","D:\\AnlogicSDK\\resources1\\AllCase.bit");
	}
	
	

	
	

	@AfterClass
	public static void tearDownAfterClass() throws Exception {
	}

}
